package com.ruoyi.hospital.service.operation.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.operation.OperationBannerMapper;
import com.ruoyi.hospital.domain.operation.OperationBanner;
import com.ruoyi.hospital.service.operation.IOperationBannerService;

/**
 * 首页BannerService业务层处理
 * 
 * @author wendao
 * @date 2024-09-13
 */
@Service
public class OperationBannerServiceImpl implements IOperationBannerService 
{
    @Autowired
    private OperationBannerMapper operationBannerMapper;

    /**
     * 查询首页Banner
     * 
     * @param id 首页Banner主键
     * @return 首页Banner
     */
    @Override
    public OperationBanner selectOperationBannerById(Integer id)
    {
        return operationBannerMapper.selectOperationBannerById(id);
    }

    /**
     * 查询首页Banner列表
     * 
     * @param operationBanner 首页Banner
     * @return 首页Banner
     */
    @Override
    public List<OperationBanner> selectOperationBannerList(OperationBanner operationBanner)
    {
        return operationBannerMapper.selectOperationBannerList(operationBanner);
    }

    /**
     * 新增首页Banner
     * 
     * @param operationBanner 首页Banner
     * @return 结果
     */
    @Override
    public int insertOperationBanner(OperationBanner operationBanner)
    {
        operationBanner.setCreateTime(DateUtils.getNowTimeSecond());
        return operationBannerMapper.insertOperationBanner(operationBanner);
    }

    /**
     * 修改首页Banner
     * 
     * @param operationBanner 首页Banner
     * @return 结果
     */
    @Override
    public int updateOperationBanner(OperationBanner operationBanner)
    {
        operationBanner.setUpdateTime(DateUtils.getNowTimeSecond());
        return operationBannerMapper.updateOperationBanner(operationBanner);
    }

    /**
     * 批量删除首页Banner
     * 
     * @param ids 需要删除的首页Banner主键
     * @return 结果
     */
    @Override
    public int deleteOperationBannerByIds(Integer[] ids)
    {
        return operationBannerMapper.deleteOperationBannerByIds(ids);
    }

    /**
     * 删除首页Banner信息
     * 
     * @param id 首页Banner主键
     * @return 结果
     */
    @Override
    public int deleteOperationBannerById(Integer id)
    {
        return operationBannerMapper.deleteOperationBannerById(id);
    }
}
